home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / outbox.idb / var / www / cgi-bin / MachineInfo.z / MachineInfo
Encoding:
Text File  |  1996-11-14  |  1.2 KB  |  65 lines

  1. #!/usr/bin/perl
  2.  
  3. #__________________________________________________________
  4. #
  5. #   File:    MachineInfo
  6. #   By:      Matt Ho
  7. #   Date:    7/23/95
  8. #   Purpose: Display host configuration
  9. #__________________________________________________________
  10.  
  11. $hostname = `/usr/bsd/hostname` ;
  12. open(DATA, "/sbin/hinv |") || &CantGetInfo ;
  13.  
  14. print <<ENDOFTEXT ;
  15. Content-type: text/html
  16. Pragma: no-cache
  17.  
  18. <head>
  19.     <title>
  20.         $hostname
  21.     </title>
  22. </head>
  23.  
  24. <body alink="ff0000" vlink="0000ee" link="0000ee" background="/outbox/images/background.gif" bgcolor="c1c1c1" text="000000">
  25.  
  26. <img src="/images/poweredsgi.gif" ALT="Powered by Silicon Graphics"><p><br>
  27. <h1 align=center>$hostname</h1>
  28. <center>
  29. <hr size=3 noshade width=50%>
  30. <table>
  31. ENDOFTEXT
  32.  
  33. while( <DATA> )
  34. {
  35.     ($name, $value) = split(':', $_, 2) ;
  36.     print <<ENDOFTEXT ;
  37. <tr>
  38.     <th align=right>
  39.         $name
  40.     </th>
  41.     <td>
  42.         $value
  43.     </td>
  44. </tr>
  45. ENDOFTEXT
  46. }
  47. close(DATA) ;
  48.  
  49. print <<ENDOFTEXT ;
  50. </table>
  51. <hr size=3 noshade width=50%>
  52. </center>
  53. ENDOFTEXT
  54.  
  55. if( defined $ENV{'HTTP_REFERER'} )
  56. {
  57.     $URL = $ENV{'HTTP_REFERER'} ;
  58.     print <<ENDOFTEXT ;
  59. <a href="$URL"><IMG SRC="/outbox/images/go-back.gif" BORDER=0 ALT="Back"></A>
  60. ENDOFTEXT
  61. }
  62.  
  63. print "\n</body></html>\n\n" ;
  64.  
  65.